package com.grad.webstudy.dao;

import com.grad.webstudy.model.Message;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MessageDao {
    int deleteByPrimaryKey(Integer id);


    int insertSelective(Message record);

    Message selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);

    /**
     * 插入信息到数据库
     * @param message
     * @return
     */
    int insert(Message message);


    /**
     * 查询历史消息
     * @param sendId
     * @param receiveId
     * @return
     */
    List<Message> queryHistoryMessages(@Param("sendId") Integer sendId, @Param("receiveId") Integer receiveId);

}